import path from 'node:path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: [
      { find: '#components', replacement: path.resolve(__dirname, './src/components/') },
      { find: '#hooks', replacement: path.resolve(__dirname, './src/hooks/') },
      { find: '#types', replacement: path.resolve(__dirname, './src/types/') },
    ],
  },
  base: '/geektime-column-oh-my-kit/',
  server: { open: true },
  plugins: [
    react({
      jsxImportSource: '@emotion/react',
      babel: {
        plugins: ['@emotion/babel-plugin'],
      },
    }),
  ],
});
